package skyinline.j2ee.basic;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.Date;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet("/02HelloServlet")
public class _02HelloServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
	protected void doGet(
			HttpServletRequest req, 
			HttpServletResponse res) throws ServletException, IOException {
		res.setContentType(
			"text/html; charset=UTF-8");
		PrintWriter out = res.getWriter();
		out.print( "<html>" );
		out.print( "<head><title>" );
		out.print( "Hello, Servlet!!" );
		out.print( "</title></head>" );
		out.print( "<body>" );
		out.print( "<h1 style='color: red'>Hello, Servlet!!</h1>" );
		out.print( "<h3>현재 시간은 " 
				+ "2013-12-30 오후 12:40:35"
				+ " 입니다~ </h3>" );
		out.print( "<h3>현재 시간은 " 
			+ new Date().toLocaleString()
			+ " 입니다~ </h3>" );
		out.print( "</body>" );
		out.print( "</html>" );
	}

}









